package sredis

import (
	"github.com/garyburd/redigo/redis"
	"log"
	"sync"
)

/*
* @Auther:create by hjx
* @Email :1245863260@qq.com g1245863260@gmail.com
* @Date  :2021/4/7 21:21
 */

var (
	RedisConn redis.Conn
	once      sync.Once
	err       error
)

func RedisClient() {
	if RedisConn == nil {
		once.Do(func() {
			RedisConn, err = redis.Dial("tcp", "127.0.0.1:6379")
			if err != nil {
				log.Fatalln(err)
			}
		})

	}
}
